<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "d_try.logo_adv".
 *
 * @property string $logo_adv_id
 * @property string $adv_name
 * @property integer $pic
 * @property string $tag
 * @property integer $tag_display
 * @property string $url
 * @property integer $status
 * @property string $recommend_starttime
 * @property string $recommend_endtime
 * @property string $add_user
 * @property string $add_time
 */
class LogoAdv extends \yii\db\ActiveRecord
{
    public static $STATUS = [0=>'不显示', 1=>'显示'];
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'd_try.logo_adv';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['adv_name', 'pic', 'url', 'recommend_starttime', 'recommend_endtime', 'add_user', 'add_time'], 'required'],
            [['pic', 'tag_display', 'status'], 'integer'],
            [['recommend_starttime', 'recommend_endtime', 'add_time'], 'safe'],
            [['adv_name'], 'string', 'max' => 100],
            [['tag'], 'string', 'max' => 3],
            [['url'], 'string', 'max' => 255],
            [['add_user'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'logo_adv_id' => 'Logo Adv ID',
            'adv_name' => '广告名称',
            'pic' => '广告图',
            'tag' => '标签',
            'tag_display' => '是否显示标签',
            'url' => 'Url',
            'status' => '是否显示广告',
            'recommend_starttime' => '推荐开始时间',
            'recommend_endtime' => '推荐结束时间',
            'add_user' => 'Add User',
            'add_time' => 'Add Time',
        ];
    }

    /**
     * @inheritdoc
     * @return \services\models\LogoAdvQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \services\models\LogoAdvQuery(get_called_class());
    }
}
